#!/bin/bash

for inc in pins2gpios gpio 
do
    if [ "$(type -t $inc)" != "function" ]
    then
	. "$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)"/$inc
    fi
done

resetArduinoFromRPi() {
  declare -a gpios=()
  gpios=$(pins2gpios "$@")

  for gpio_pin in ${gpios[@]}
  do
      gpio_set $gpio_pin 0
  done

  sleep 0.010

  for gpio_pin in ${gpios[@]}
  do
      unused=$(gpio_get $gpio_pin)
  done
}

if [ "$(basename $0)" == "resetArduinoFromRPi" ]
then
    resetArduinoFromRPi "$@"
fi
